[expr_, base, attrHead] = matches;
methods = getPropertyNamesFromExpression(base, commandHeader).filter(
- attr => attr.slice(0, attrHead.length) == attrHead
- );
+ attr => attr.slice(0, attrHead.length) === attrHead);
}
// Look for the empty expression or partially entered words
if (text == '' || matches) {
[expr_, attrHead] = matches;
methods = globalCompletionList.filter(
- attr => attr.slice(0, attrHead.length) == attrHead
- );
+ attr => attr.slice(0, attrHead.length) === attrHead);
}
}
// Cache the window list now; we don't handle dynamic changes here,
// and we don't want to be continually retrieving it
appIcon.cachedWindows = allWindows.filter(
- w => windowTracker.get_window_app(w) == appIcon.app
- );
+ w => windowTracker.get_window_app(w) === appIcon.app);
if (appIcon.cachedWindows.length > 0)
this._addIcon(appIcon);
}
this._canScroll = true;
this._scrollTimeoutId = 0;
return GLib.SOURCE_REMOVE;
- }
- );
+ });
return Clutter.EVENT_STOP;
}
return app && this._parentalControlsManager.shouldShowApp(app.app_info);
});
results = results.concat(group.sort(
- (a, b) => usage.compare(a, b)
- ));
+ (a, b) => usage.compare(a, b)));
});
results = results.concat(this._systemActions.getMatchingActions(terms));
this.removeAll();
let windows = this._source.app.get_windows().filter(
- w => !w.skip_taskbar
- );
+ w => !w.skip_taskbar);
if (windows.length > 0) {
this.addMenuItem(
/* Translators: This is the heading of a list of open windows */
- new PopupMenu.PopupSeparatorMenuItem(_("Open Windows"))
- );
+ new PopupMenu.PopupSeparatorMenuItem(_('Open Windows')));
}
windows.forEach(window => {
_onDeviceSelected(dialog, device) {
let connection = this._dbusImpl.get_connection();
let info = this._dbusImpl.get_info();
- let deviceName = Object.keys(AudioDevice).filter(
- dev => AudioDevice[dev] == device
- )[0].toLowerCase();
+ const deviceName = Object.keys(AudioDevice)
+ .filter(dev => AudioDevice[dev] === device)[0].toLowerCase();
connection.emit_signal(this._audioSelectionDialog._sender,
this._dbusImpl.get_object_path(),
info ? info.name : null,
_sessionUpdated() {
let newEnabledComponents = Main.sessionMode.components;
- newEnabledComponents.filter(
- name => !this._enabledComponents.includes(name)
- ).forEach(name => {
- this._enableComponent(name);
- });
-
- this._enabledComponents.filter(
- name => !newEnabledComponents.includes(name)
- ).forEach(name => {
- this._disableComponent(name);
- });
+ newEnabledComponents
+ .filter(name => !this._enabledComponents.includes(name))
+ .forEach(name => this._enableComponent(name));
+
+ this._enabledComponents
+ .filter(name => !newEnabledComponents.includes(name))
+ .forEach(name => this._disableComponent(name));
this._enabledComponents = newEnabledComponents;
}
_emitCallback(mount, contentTypes = []) {
// we're not interested in win32 software content types here
contentTypes = contentTypes.filter(
- type => type != 'x-content/win32-software'
- );
+ type => type !== 'x-content/win32-software');
let apps = [];
contentTypes.forEach(type => {
// Find and enable all the newly enabled extensions: UUIDs found in the
// new setting, but not in the old one.
- newEnabledExtensions.filter(
- uuid => !this._enabledExtensions.includes(uuid)
- ).forEach(uuid => {
- this._callExtensionEnable(uuid);
- });
+ newEnabledExtensions
+ .filter(uuid => !this._enabledExtensions.includes(uuid))
+ .forEach(uuid => this._callExtensionEnable(uuid));
// Find and disable all the newly disabled extensions: UUIDs found in the
// old setting, but not in the new one.
- this._extensionOrder.filter(
- uuid => !newEnabledExtensions.includes(uuid)
- ).reverse().forEach(uuid => {
- this._callExtensionDisable(uuid);
- });
+ this._extensionOrder
+ .filter(uuid => !newEnabledExtensions.includes(uuid))
+ .reverse().forEach(uuid => this._callExtensionDisable(uuid));
this._enabledExtensions = newEnabledExtensions;
}
this.add_child(this._emojiPager);
this._pageIndicator = new PageIndicators.PageIndicators(
- Clutter.Orientation.HORIZONTAL
- );
+ Clutter.Orientation.HORIZONTAL);
this.add_child(this._pageIndicator);
this._pageIndicator.setReactive(false);
'brightness': GObject.ParamSpec.float(
'brightness', 'brightness', 'brightness',
GObject.ParamFlags.READWRITE,
- 0, 1, 1
- ),
+ 0, 1, 1),
'sharpness': GObject.ParamSpec.float(
'sharpness', 'sharpness', 'sharpness',
GObject.ParamFlags.READWRITE,
- 0, 1, 0
- ),
+ 0, 1, 0),
},
}, class RadialShaderEffect extends Shell.GLSLEffect {
_init(params) {
const keywords = ['true', 'false', 'null', 'new'];
// Don't add the private properties of globalThis (i.e., ones starting with '_')
const windowProperties = Object.getOwnPropertyNames(globalThis).filter(
- a => a.charAt(0) != '_'
- );
+ a => a.charAt(0) !== '_');
const headerProperties = JsParse.getDeclaredConstants(commandHeader);
return keywords.concat(windowProperties).concat(headerProperties);
// Applies only to the first zoom region.
if (this._zoomRegions.length) {
this._zoomRegions[0].setClampScrollingAtEdges(
- !this._settings.get_boolean(CLAMP_MODE_KEY)
- );
+ !this._settings.get_boolean(CLAMP_MODE_KEY));
}
}
// Applies only to the first zoom region.
if (this._zoomRegions.length) {
this._zoomRegions[0].setMouseTrackingMode(
- this._settings.get_enum(MOUSE_TRACKING_KEY)
- );
+ this._settings.get_enum(MOUSE_TRACKING_KEY));
}
}
// Applies only to the first zoom region.
if (this._zoomRegions.length) {
this._zoomRegions[0].setFocusTrackingMode(
- this._settings.get_enum(FOCUS_TRACKING_KEY)
- );
+ this._settings.get_enum(FOCUS_TRACKING_KEY));
}
}
// Applies only to the first zoom region.
if (this._zoomRegions.length) {
this._zoomRegions[0].setCaretTrackingMode(
- this._settings.get_enum(CARET_TRACKING_KEY)
- );
+ this._settings.get_enum(CARET_TRACKING_KEY));
}
}
// Applies only to the first zoom region.
if (this._zoomRegions.length) {
this._zoomRegions[0].setInvertLightness(
- this._settings.get_boolean(INVERT_LIGHTNESS_KEY)
- );
+ this._settings.get_boolean(INVERT_LIGHTNESS_KEY));
}
}
// Applies only to the first zoom region.
if (this._zoomRegions.length) {
this._zoomRegions[0].setColorSaturation(
- this._settings.get_double(COLOR_SATURATION_KEY)
- );
+ this._settings.get_double(COLOR_SATURATION_KEY));
}
}
// it modifies the brightness and/or contrast.
let [cRed, cGreen, cBlue] = this._brightnessContrast.get_contrast();
this._brightnessContrast.set_enabled(
- bRed != NO_CHANGE || bGreen != NO_CHANGE || bBlue != NO_CHANGE ||
- cRed != NO_CHANGE || cGreen != NO_CHANGE || cBlue != NO_CHANGE
- );
+ bRed !== NO_CHANGE || bGreen !== NO_CHANGE || bBlue !== NO_CHANGE ||
+ cRed !== NO_CHANGE || cGreen !== NO_CHANGE || cBlue !== NO_CHANGE);
}
/**
// a null first argument.
let [bRed, bGreen, bBlue] = this._brightnessContrast.get_brightness();
this._brightnessContrast.set_enabled(
- cRed != NO_CHANGE || cGreen != NO_CHANGE || cBlue != NO_CHANGE ||
- bRed != NO_CHANGE || bGreen != NO_CHANGE || bBlue != NO_CHANGE
- );
+ cRed !== NO_CHANGE || cGreen !== NO_CHANGE || cBlue !== NO_CHANGE ||
+ bRed !== NO_CHANGE || bGreen !== NO_CHANGE || bBlue !== NO_CHANGE);
}
};
this._onNotificationDestroy.bind(this));
this._notificationQueue.push(notification);
this._notificationQueue.sort(
- (n1, n2) => n2.urgency - n1.urgency
- );
+ (n1, n2) => n2.urgency - n1.urgency);
this.emit('queue-changed');
}
}
_getDesktopClone() {
let windows = global.get_window_actors().filter(
- w => w.meta_window.get_window_type() == Meta.WindowType.DESKTOP
- );
+ w => w.meta_window.get_window_type() === Meta.WindowType.DESKTOP);
if (windows.length == 0)
return null;
_getDraggableWindowForPosition(stageX) {
let workspaceManager = global.workspace_manager;
- let workspace = workspaceManager.get_active_workspace();
- let allWindowsByStacking = global.display.sort_windows_by_stacking(
- workspace.list_windows()
- ).reverse();
+ const windows = workspaceManager.get_active_workspace().list_windows();
+ const allWindowsByStacking =
+ global.display.sort_windows_by_stacking(windows).reverse();
return allWindowsByStacking.find(metaWindow => {
let rect = metaWindow.get_frame_rect();
_ensureResultActors(results, callback) {
let metasNeeded = results.filter(
- resultId => this._resultDisplays[resultId] === undefined
- );
+ resultId => this._resultDisplays[resultId] === undefined);
if (metasNeeded.length === 0) {
callback(true);
this._keyfilesLabel = new St.Label({ visible: false });
this._keyfilesLabel.clutter_text.set_markup(
/* Translators: %s is the Disks application */
- _("To unlock a volume that uses keyfiles, use the <i>%s</i> utility instead.").format(disksApp.get_name())
- );
+ _('To unlock a volume that uses keyfiles, use the <i>%s</i> utility instead.')
+ .format(disksApp.get_name()));
this._keyfilesLabel.clutter_text.ellipsize = Pango.EllipsizeMode.NONE;
this._keyfilesLabel.clutter_text.line_wrap = true;
content.add_child(this._keyfilesLabel);
/* Translators: %s is the Disks application */
_("Unable to start %s").format(app.get_name()),
/* Translators: %s is the Disks application */
- _("Couldn’t find the %s application").format(app.get_name())
- );
+ _('Couldn’t find the %s application').format(app.get_name()));
}
this._onCancelButton();
}
let connections = client.get_connections();
this._connections = connections.filter(
- connection => device.connection_valid(connection)
- );
+ connection => device.connection_valid(connection));
this._apAddedId = device.connect('access-point-added', this._accessPointAdded.bind(this));
this._apRemovedId = device.connect('access-point-removed', this._accessPointRemoved.bind(this));
_syncVpnConnections() {
let activeConnections = this._client.get_active_connections() || [];
let vpnConnections = activeConnections.filter(
- a => a instanceof NM.VpnConnection
- );
+ a => a instanceof NM.VpnConnection);
vpnConnections.forEach(a => {
ensureActiveConnectionProps(a);
});
});
let app = this._settingsApp = Shell.AppSystem.get_default().lookup_app(
- 'gnome-control-center.desktop'
- );
+ 'gnome-control-center.desktop');
if (app) {
let [icon, name] = [app.app_info.get_icon().names[0],
app.get_name()];
this._canScroll = true;
this._scrollTimeoutId = 0;
return GLib.SOURCE_REMOVE;
- }
- );
+ });
return Clutter.EVENT_STOP;
}